﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Visifire.Gauges;

namespace CPPEI.Coolzon.UI.DataPartLib
{
    /// <summary>
    /// DataGaugeVerticalLinearScale.xaml 的交互逻辑
    /// </summary>
    [System.ComponentModel.DisplayName("纵向线性仪表盘")]
    [XPartIcon("pack://application:,,,/CPPEI.Coolzon.UI.DataPartLib;component/Images/PartIcons/单值纵向线性仪表.png")]
    public partial class DataGaugeVerticalLinearScale : DataGaugeLinearScale
    {
        public DataGaugeVerticalLinearScale()
        {
            LinearGradientBrush lgb = new LinearGradientBrush();
            lgb.StartPoint = new Point(0, 0.5);
            lgb.EndPoint = new Point(1, 0.5);
            GradientStop gs = new GradientStop(Color.FromArgb(0xFF, 0xDB, 0xE8, 0xA2), 0);
            GradientStop gs1 = new GradientStop(Color.FromArgb(0xFF, 0xC6, 0xE0, 0xB3), 0.4);
            GradientStop gs2 = new GradientStop(Color.FromArgb(0xFF, 0x56, 0x8E, 0x35), 0.6);
            GradientStop gs3 = new GradientStop(Color.FromArgb(0xFF, 0x75, 0xA6, 0x26), 1);
            lgb.GradientStops.Add(gs);
            lgb.GradientStops.Add(gs1);
            lgb.GradientStops.Add(gs2);
            lgb.GradientStops.Add(gs3);
            BarBackground = new BrushEx(lgb);
            LinearBackground = new BrushEx(new SolidColorBrush(Colors.Gray));
            BarPlacement = PlacementTypes.Center;
            IsHorizontal = false;

            InitializeComponent();
        }

        protected override Gauge GetGauge()
        {
            return _ctlGauge;
        }
    }
}
